package com.tianyuan.controller;

import com.tianyuan.domain.Persons;
import com.tianyuan.service.api.PersonService;
import com.tianyuan.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: cap
 * @description: 个人信息交互
 * @author: Mr.Wang
 * @create: 2020-06-29 10:25
 **/
@RestController
@RequestMapping("api")
public class PersonController {

    @Autowired
    private PersonService service;

    @GetMapping(value = "findAll")
    public R findAll(){
        List<Persons> list = service.findAll();
        return R.ok("OK").put("data",list);
    }
}
